﻿using OpenTK;

namespace Chimp.Core.Actors
{
    public class ActorText : ChimpBase
    {
        public float Blur = 0.05f;
        public Vector4 Color = new Vector4(0.2f, 0.1f, 0.1f, 0.5f);

        public ActorText(string txt, int w, int h) : base(w, h)
        {
            Text = txt;
            //   SetBaseFX_Blur();
        }

        public string Text { get; set; }

        public override void OnDraw(Vector2 pos)
        {
            //     SetFX_Blur(0.0f);
            ChimpDraw.TextColor = Color;
            ChimpDraw.Text(DrawPos + ChimpDraw.TextAlign(Text), Text);
        }

        public override void OnDrawShape(Vector2 pos)
        {
            ChimpText.ChimpTextCache tex = ChimpDraw.CheckText(Text);
            ChimpDraw.ShapeBlit(
                new Vector4(DrawPos.X + ChimpDraw.TextAlign(Text).X, DrawPos.Y + ChimpDraw.TextAlign(Text).Y, tex.Width,
                            tex.Height), DrawRotation, DrawScale, tex.Visual, false);
        }
    }
}